package com.derek.omshopping.ui.home.view;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.derek.omshopping.R;
import com.derek.omshopping.base.BaseFragment;
import com.derek.omshopping.config.UrlConfig;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by duyb on 2016-10-19.
 * Desc:全球购
 */

public class GlobalFragment extends BaseFragment {

    @BindView(R.id.global_webview)
    WebView wv;

    @Override
    protected void initData() {
        wv.getSettings().setJavaScriptEnabled(true);//设置webview支持脚本 javaScript
        wv.setWebChromeClient(new WebChromeClient());
        wv.setWebViewClient(new WebViewClient());
        wv.loadUrl(UrlConfig.GLOBAL_SHOPPING_URL);
    }

    @Override
    protected void initView() {

    }

    @Override
    public int getLayoutId() {
        return R.layout.fragment_webview;
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View rootView = super.onCreateView(inflater, container, savedInstanceState);
        ButterKnife.bind(this, rootView);
        return rootView;
    }
}
